﻿<div class="top-row pl-4 navbar navbar-dark">
    <a class="navbar-brand" href="">BlazorApp</a>
    <button class="navbar-toggler" @onclick="ToggleNavMenu">
        <span class="navbar-toggler-icon"></span>
    </button>
</div>

<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
    <ul class="nav flex-column">
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                <span class="oi oi-home" aria-hidden="true"></span> Home
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="counter">
                <span class="oi oi-plus" aria-hidden="true"></span> Counter
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="fetchdata">
                <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="todo">
                <span class="oi oi-list" aria-hidden="true"></span> Todo
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="chat">
                <span class="oi oi-person" aria-hidden="true"></span> Chat
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="upload-files">
                <span class="oi oi-file" aria-hidden="true"></span> Upload Files
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="tab">
                <span class="oi oi-tablet" aria-hidden="true"></span> Tab
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="bind">
                <span class="oi oi-document" aria-hidden="true"></span> Data Bind
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="event-handler">
                <span class="oi oi-document" aria-hidden="true"></span> Event Handler
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="template-component">
                <span class="oi oi-document" aria-hidden="true"></span> Template Component
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="css">
                <span class="oi oi-document" aria-hidden="true"></span> CSS 隔离
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="rcl">
                <span class="oi oi-document" aria-hidden="true"></span> Razor 类库
            </NavLink>
        </li>
        <li class="nav-item px-3">
            <NavLink class="nav-link" href="layout">
                <span class="oi oi-document" aria-hidden="true"></span> Layout
            </NavLink>
        </li>
    </ul>
</div>

@code {
    private bool collapseNavMenu = true;

    private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;

    private void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }
}
